package project.model;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;

public class PrComment_tc extends HashMap{

	private String idComment;
	private String idTestProject;
	private String idEmployee;
	private String comment;
	private Date dateComment;

	private String employeeName;
	private String displayDate;
	DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");

	
	public PrComment_tc(){		
	}
	
	public PrComment_tc(String idComment, String idTestProject, String idEmployee, String comment, Date dateComment, String employeeName) {
		this.idComment = idComment;
		this.idTestProject = idTestProject;
		this.idEmployee = idEmployee;
		this.comment = comment;
		this.dateComment = dateComment;
		this.employeeName = employeeName;
	}

	public String getIdComment() {
		return idComment;
	}

	public void setIdComment(String idComment) {
		this.idComment = idComment;
	}

	public String getIdTestProject() {
		return idTestProject;
	}

	public void setIdTestProject(String idTestProject) {
		this.idTestProject = idTestProject;
	}

	public String getIdEmployee() {
		return idEmployee;
	}

	public void setIdEmployee(String idEmployee) {
		this.idEmployee = idEmployee;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public Date getDateComment() {
		return dateComment;
	}

	public void setDateComment(Date dateComment) {
		this.dateComment = dateComment;
	}

	public void setEmployeeName(String employeeName) {
		this.employeeName = employeeName;
	}

	public String getEmployeeName() {
		return employeeName;
	}

	public void setDisplayDate(String displayDate) {
		this.displayDate = displayDate;
	}

	public String getDisplayDate() {
		displayDate = format.format(dateComment);
		return displayDate;
	}
	
	public static String KEY_COMMENT="comment";
	public static String KEY_EMPLOYEE="employeeName";
	public static String KEY_DATECOMMENT="dateComment";
	@Override
	public String get(Object k){
		String key=(String) k;
		if(KEY_COMMENT.equals(key))
			return comment;
		else if(KEY_EMPLOYEE.equals(key))
			return employeeName;
		else if(KEY_DATECOMMENT.equals(key))
			return dateComment.toString();
		return null;
	}
	
}
